package com.banshuibao.bsb_android.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;

import com.banshuibao.bsb_android.R;
import com.banshuibao.bsb_android.util.StatusBarUtils;

/**
 * Created by wangpan on 2017/11/29.
 */

public class BaseFragment extends Fragment{
    private boolean isWindowsTranslucent;

    private View status_bar;
    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        isWindowsTranslucent = true;
        if (!StatusBarUtils.setWindowsTranslucent(null, getActivity())) {
            isWindowsTranslucent = false;
            //StatusBarUtils.setWindowStatusBarColor(this, getResources().getColor(R.color.user_icon_stroke_blue1));
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        if (!isWindowsTranslucent && status_bar == null) {
            status_bar = getView().findViewById(R.id.system_status_bar);
            if (status_bar != null)
                status_bar.setVisibility(View.GONE);
        }
    }
}
